package com.joolun.weixin.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.joolun.common.utils.DateUtils;
import com.joolun.weixin.entity.ZbActiveConfig;
import com.joolun.weixin.mapper.ZbActiveConfigMapper;
import com.joolun.weixin.service.IZbActiveConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 直播活动配置Service业务层处理
 * 
 * @author joolun
 * @date 2025-04-24
 */
@Service
public class ZbActiveConfigServiceImpl extends  ServiceImpl<ZbActiveConfigMapper, ZbActiveConfig> implements IZbActiveConfigService
{
    @Autowired
    private ZbActiveConfigMapper zbActiveConfigMapper;

    /**
     * 查询直播活动配置
     * 
     * @param id 直播活动配置主键
     * @return 直播活动配置
     */
    @Override
    public ZbActiveConfig selectZbActiveConfigById(Long id)
    {
        return zbActiveConfigMapper.selectZbActiveConfigById(id);
    }

    /**
     * 查询直播活动配置列表
     * 
     * @param zbActiveConfig 直播活动配置
     * @return 直播活动配置
     */
    @Override
    public List<ZbActiveConfig> selectZbActiveConfigList(ZbActiveConfig zbActiveConfig)
    {
        return zbActiveConfigMapper.selectZbActiveConfigList(zbActiveConfig);
    }

    /**
     * 新增直播活动配置
     * 
     * @param zbActiveConfig 直播活动配置
     * @return 结果
     */
    @Override
    public int insertZbActiveConfig(ZbActiveConfig zbActiveConfig)
    {
        zbActiveConfig.setCreateTime(DateUtils.getNowDate());
        return zbActiveConfigMapper.insertZbActiveConfig(zbActiveConfig);
    }

    /**
     * 修改直播活动配置
     * 
     * @param zbActiveConfig 直播活动配置
     * @return 结果
     */
    @Override
    public int updateZbActiveConfig(ZbActiveConfig zbActiveConfig)
    {
        zbActiveConfig.setUpdateTime(DateUtils.getNowDate());
        return zbActiveConfigMapper.updateZbActiveConfig(zbActiveConfig);
    }

    /**
     * 批量删除直播活动配置
     * 
     * @param ids 需要删除的直播活动配置主键
     * @return 结果
     */
    @Override
    public int deleteZbActiveConfigByIds(Long[] ids)
    {
        return zbActiveConfigMapper.deleteZbActiveConfigByIds(ids);
    }

    /**
     * 删除直播活动配置信息
     * 
     * @param id 直播活动配置主键
     * @return 结果
     */
    @Override
    public int deleteZbActiveConfigById(Long id)
    {
        return zbActiveConfigMapper.deleteZbActiveConfigById(id);
    }
}
